<template>
  <div id="echarts3"></div>
</template>

<script>
import * as echarts from "echarts";

export default {
  name: "Echarts3",
  data() {
    return {
      echarts:''
    }
  },
  mounted() {
    this.initEcharts()
  },
  methods: {
    initEcharts() {
      const chartDom = document.getElementById('echarts3')
      this.echarts = echarts.init(chartDom)

    },
    setEChartsOptions(data){
      const option = {
        title: {
          text: '项目任务进度统计:',
          // subtext: ' Data',
          top: 'left'
        },
        tooltip: {
          trigger: 'item'
        },
        legend: {
          // orient: '',
          bottom: 'bottom'
        },
        series: [
          {
            name: '项目状态',
            type: 'pie',
            radius: '50%',
            data: [
              {value: data.un_start_count, name: '未开始'},
              {value: data.processing_count, name: '正常开始'},
              {value: data.delay_count, name: '拖延开始'},
              {value: data.postpone_count, name: '延期数量'},
              {value: data.complete_before_count, name: '提前完成'},
              {value: data.complete_equal_count, name: '正常完成'},
              {value: data.complete_after_count, name: '拖延完成'}
            ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
            }
          }
        ]
      };
      this.echarts && this.echarts.setOption(option);
    },
  }
}
</script>

<style scoped lang="scss">
#echarts3{
  width: 100%;
  height: 100%;
}
</style>
